<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\RepairService;

class Repair extends Api
{
    protected $noNeedLogin = ['power','package','package_type'];
    protected $noNeedRight = ['*'];

    /**
     * 报修分类
     *
     */
    public function type()
    {
        $res = RepairService::getType();
        return json($res);
    }

    /**
     * 报修下拉设置
     *
     */
    public function set()
    {
        $data = $this->request->post();
        $res = RepairService::setType($data);
        return json($res);
    }

    /**
     * 报修问题
     *
     */
    public function problem()
    {
        $data = $this->request->post();
        $res = RepairService::getProblem($data);
        return json($res);
    }

    /**
     * 报修费用
     *
     */
    public function repair_fee()
    {
        $res = RepairService::getRepairFee();
        return json($res);
    }

    /**
     * 创建订单
     *
     */
    public function create()
    {
        $data = $this->request->post();
        $res = RepairService::createOrder($data);
        return json($res);
    }
}